package com.example.obj;

public class ContactObject {
	public String id;
	public String firstName;
	public String lastName;
	public String address = "";
	public String phoneHome;
	public String phoneMobile = "";
	public String phoneWork = "";
	public String email = "";
	public String email2 = "";
	public String bday = "-";
	public String bmonth = "-";
	public String byear = "";
	public String groupName = "[none]";
	public String address2 = "";
	public String phone2 = "";
	
	public ContactObject setId(String id) {
		this.id = id;
		return this;
	}
	public ContactObject setFirstName(String firstName) {
		this.firstName = firstName;
		return this;
	}
	public ContactObject setLastName(String lastName) {
		this.lastName = lastName;
		return this;
	}
	public ContactObject setAddress(String address) {
		this.address = address;
		return this;
	}
	public ContactObject setPhoneHome(String phoneHome) {
		this.phoneHome = phoneHome;
		return this;
	}
	public ContactObject setPhoneMobile(String phoneMobile) {
		this.phoneMobile = phoneMobile;
		return this;
	}
	public ContactObject setPhoneWork(String phoneWork) {
		this.phoneWork = phoneWork;
		return this;
	}
	public ContactObject setEmail(String email) {
		this.email = email;
		return this;
	}
	public ContactObject setEmail2(String email2) {
		this.email2 = email2;
		return this;
	}
	public ContactObject setBday(String bday) {
		this.bday = bday;
		return this;
	}
	public ContactObject setBmonth(String bmonth) {
		this.bmonth = bmonth;
		return this;
	}
	public ContactObject setByear(String byear) {
		this.byear = byear;
		return this;
	}
	public ContactObject setGroupName(String groupName) {
		this.groupName = groupName;
		return this;
	}
	public ContactObject setAddress2(String address2) {
		this.address2 = address2;
		return this;
	}
	public ContactObject setPhone2(String phone2) {
		this.phone2 = phone2;
		return this;
	}
	
	public String getId() {
		return id;
	}
	public String getFirstName() {
		return firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public String getAddress() {
		return address;
	}
	public String getPhoneHome() {
		return phoneHome;
	}
	public String getPhoneMobile() {
		return phoneMobile;
	}
	public String getPhoneWork() {
		return phoneWork;
	}
	public String getEmail() {
		return email;
	}
	public String getEmail2() {
		return email2;
	}
	public String getBday() {
		return bday;
	}
	public String getBmonth() {
		return bmonth;
	}
	public String getByear() {
		return byear;
	}
	public String getGroupName() {
		return groupName;
	}
	public String getAddress2() {
		return address2;
	}
	public String getPhone2() {
		return phone2;
	}
	@Override
	public String toString() {
		return "ContactObject [" + id + ": " + firstName + " "  
				+ lastName +  " H: " + phoneHome + "]";
	}
	@Override
	public int hashCode() {		
		int result = 1;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactObject other = (ContactObject) obj;
		if ((firstName + " " + lastName) == null) {
			if ((other.firstName + " " + other.lastName) != null)
				return false;
		} else if (!(firstName + " " + lastName).equals((other.firstName + " " + other.lastName)))
			return false;
		if (id != null && other.id != null) {
			if (!id.equals(other.id))
			return false;
		}
		if (phoneHome == null || phoneHome == ""){
			if (other.phoneHome != null && other.phoneHome != "") 
				return false;
		} else if (!phoneHome.equals(other.phoneHome))
			return false;
	
		return true;
	}
}